<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet"		type="text/css"		href="JO_04_2_CSS.CSS"					/> 
<link rel="stylesheet"		type="text/css"		href="JO_04_CSS.css"					/> 
		<script type="text/javascript" src="vadilation.js"></script>
<title>Untitled Document</title>


</head>
<?php 

	include_once( "JO_01_configuration.php"	);
	include_once( "JO_02_function.php"		);
	$JO_MySQL = new mysqli( $JO_DB_host, $JO_DB_user, $JO_DB_password, $JO_DB_database );
				$JO_MySQL -> query( "SET NAMES 'UTF8'" );

?>
<body
style="background:none">
<script>
function FcheckFormTD(f){
if(!FcheckFilled('type ',f.type.value)){ f.type.focus();return false; }
if(!FcheckFilled('subject ',f.subject.value)){ f.subject.focus();return false; }
if(!FcheckFilled('start_date ',f.start_date.value)){ f.start_date.focus();return false; }
if(!FcheckFilled('expired_date ',f.expired_date.value)){ f.expired_date.focus();return false; }
if(!FcheckFilled('note ',f.note.value)){ f.note.focus();return false; }
if(!FcheckFilled('amount ',f.amount.value)){ f.amount.focus();return false; }
if(!FcheckNumber('amount',f.amount.value)){ f.amount.focus();return false; }
//if(!FcheckBoxes('Lĩnh vực',f.lbxlinhvuc,1,0)){f.lbxlinhvuc[0].focus();return false;}
//if(!FcheckFilled('Địa điểm làm việc',f.txtdiadiemlamviec.value)){ f.txtdiadiemlamviec.focus();return false; }
//if(!FcheckFilled('Mô tả sơ lược',f.txtmota.value)){ f.txtmota.focus();return false; }
//if(!FcheckFilled('kỹ năng công việc',f.txtkynang.value)){ f.txtkynang.focus();return false; }
//if(!FcheckFilled('mức lương',f.txtmucluong.value)){ f.txtmucluong.focus();return false; }
//if(!FcheckFilled('chế độ',f.txtchedo.value)){ f.txtchedo.focus();return false; }
//if(!FcheckFilled('yêu cầu hồ sơ',f.txthoso.value)){ f.txthoso.focus();return false; }
//if(!FcheckFilled('hạn nộp hồ sơ',f.txthannop.value)){ f.txthannop.focus();return false; }





//stemt.submit();
//stetc.submit();
return true;
}
</script>
  <h2 style="padding:0px;margin:0;margin-bottom:8px;width:50%"><?=isset( $_REQUEST[ "key" ])?"Edit Top":"Add Thêm Top"?></h2>
    <?php
	if(isset( $_REQUEST[ "key" ])) {
		

			$query = "
				SELECT	*
				FROM	`recommendation`
				WHERE	`key` = '" . $_REQUEST[ "key" ] . "'
			";

			$recordSet = JO_query( $query );

			if( $recordSet -> num_rows ) $record = $recordSet -> fetch_array( );

		}
					?>  
                    <iframe
			id		= 'JO_integration_asynchronous'
			name	= 'JO_integration_asynchronous'
			style	= "
				width:	<?= $_SESSION[ "JO_account_debug" ] ? "100%"	: "0px" ?>;
				height:	<?= $_SESSION[ "JO_account_debug" ] ? "10%"		: "0px" ?>;
			"
		></iframe>
			<form method="post" action="JO_05_execution.php" target="JO_integration_asynchronous" onsubmit=" return FcheckFormTD(this);">
            <input type="hidden" name="JO_query" value="<?=isset( $_REQUEST[ "key" ])?"update_recommendation":"insert_recommendation"?>" />
            <input type="hidden" name="key" value="<?=$_REQUEST[ "key" ]?>" />
            
            <table>
					<tr>
						<th style="width: 81px;">Type </th>
						<td>
                        <select style="width:372px" name="type">
   						 <?php
	
		

							$query = "
							SELECT	`subject`
							FROM	`type`
							WHERE		`delete` is null
							";

						$recordSet = JO_query( $query );

						if( $recordSet -> num_rows ){ while( $records = $recordSet -> fetch_array( ) ) {

		
							?>  
							<option  style="height:24px;width:354px" value="<?=$records['subject']?>"><?=$records['subject']?></option>
							<?php }
							
						}?>
						</select>
						</td>
					</tr>
					<tr>
						<th style="width: 81px;">Subject </th>
						<td>

							<input type="text" name="subject" style="height:24px;width:360px" value="<?=isset( $_REQUEST[ "key" ])?$record['subject']:""?>"/> <br /> 

						</td>
					</tr>
       			<tr>
						<th style="width: 81px;">Description </th>
						<td>

							<textarea name="description" cols="2" rows="2"   style="height:76px;width:356px;" value="" ><?=isset( $_REQUEST[ "key" ])?$record['description']:""?></textarea> <br /> 

						</td>
					</tr>
                    <tr>
						<th style="width: 81px;">Amount </th>
						<td>

							<input type="text" name="amount" style="height:24px;width:360px" value="<?=$record['amount']?>"/> <br /> 

						</td>
					</tr>
                    <tr>
						<th style="width: 81px;">Start_date </th>
						<td>

							<input type="text" name="start_date" style="height:24px;width:360px" value="<?=$record['start_date']?>"/> <br /> 

						</td>
					</tr>
                    <tr>
						<th style="width: 81px;">Expired_date </th>
						<td>

							<input type="text" name="expired_date" style="height:24px;width:360px" value="<?=$record['expired_date']?>"/> <br /> 

						</td>
					</tr>
                    <tr>
						<th style="width: 81px;">Note </th>
						<td>

							<input type="text" name="note" style="height:24px;width:360px" value="<?=$record['note']?>"/> <br /> 

						</td>
					</tr>
                    <tr>
						<th style="width: 81px;"> </th>
						<td>

							<input type="submit" name="submit" value="<?=isset( $_REQUEST[ "key" ])?" Update":"Submit"?>" style="height:24px;width:372px"/> <br /> 

						</td>
					</tr>
               </table>
             </form>
            
</body>
</html>